@extends('admin.layouts.master')
@section('css')
    <style>
        /*搜索框所在的区域*/
        .main_header{
            float: left;
            margin-top: 8px;
            width:100%;
            height: 100px;
            line-height: 100px;

        }
        .main_header_search{
            float: left;
            width: 155px;
            position: relative;
        }
        .main_header_search input{
            border-radius:6px;
            width: 180px;
            height: 40px;
            margin-top: 30px;
            border: 0px solid;
        }
        /*.main_header_search input:hover{*/
            /*box-shadow: 0 8px 12px rgba(0,0,0,0.2);*/
        /*}*/
        {{--.icon_fdj{--}}
            {{--z-index: 10;--}}
            {{--top: 40px;--}}
            {{--left:5px;--}}
            {{--position: absolute;--}}
            {{--background: url("{{asset('images/search_icon.png')}}") no-repeat 0 0;--}}
            {{--width: 26px;--}}
            {{--height: 26px;--}}
        {{--}--}}
        /*.main_header_search input{*/
            /*padding-left:45px;*/
            /*font-size: 16px;*/
            /*color:#ccc;*/
        /*}*/
        /*================*/
        .main_header_add{
            float: right;
            width: 215px;
            height: 100px;
            line-height: 100px;
            text-align: right;

        }
        .add_box {
            float:right;
            width: 90px;
            height: 40px;
            margin-top: 32px;
            background: #fff;
            line-height: 40px;
            cursor: pointer;
            border-radius: 6px;
            margin-left:17px;
        }
        .add_box:hover{
            box-shadow: 0 8px 12px rgba(0,0,0,0.2);
        }

        .add_box img{
            float:left;
            margin-top:6px;
            margin-left:6px;
            width: 28px;
            height: 28px;
            line-height: 40px;
        }
        .add_box span{
            float: left;
            font-size:18px;
            margin-left: 8px;
            color:  #24a7f6;
        }
        /*======主要内容区=====*/
        .main_form{
            float: left;
            width: 100%;
            height: 783px;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 8px 12px rgba(0,0,0,0.2);
        }
        .main_formlist{
            margin-top:30px;
        }
        .main_table{
            width: 94%;
            margin: 0 auto;
            border: 1px solid #B1B1B1;
        }
        .main_table tr{
            height: 15px;
            width: 100%;
        }
        .main_table tr th{
            text-align: center;
            line-height: 20px;
            height: 20px;
            font-size: 18px;
        }
        .main_table tr td{
            text-align: center;
        }
        /*======操作中的编辑与删除的样式======*/
        .formlist_handle a{
            font-size:18px;
            text-decoration: none;
        }
        .formlist_edit{
            color: #79C9F7;
        }
        .formlist_destory{
            color: red;
        }

        /*laravel自带的分页样式*/
        .boot_fenye{
            margin: 0 auto;
            margin-top:2px;
            width: 94%;
            height: 55px;
        }
        .boot_page{
            float: right;

        }
        .boot_page_di{
            margin-left: 10px;
            float: left;
            text-align: right;
            font-size: 14px;
            height: 74px;
            line-height: 74px;

        }
        .boot_page_di_span{
            width: 34px;
            height: 34px;
            border: 1px solid #D6D6D1;
        }
        .boot_page_total{
            margin-left: 10px;
            float:left;
            text-align: right;
            font-size: 14px;
            height: 74px;
            line-height: 74px;


        }
        .boot_choose{
            margin-left:20px;
            float:right;
        }
        /*master引入后显示==会员管理*/
        .vip_manage{
            background: #393F64;
        }
        /*bootstrap-js弹窗的css*/
        .modal_info{
            padding-left: 90px;
           margin: 0 auto;

        }
        .blinfo{
            width: 400px;
            height: 70px;

        }
        .blinfo span{

           /* padding-left: 163px;*/
            font-size: 16px;
            font-weight: 600;
        }
        .blinfo input{

           margin-top: 12px;
           width: 100%;
           height: 40px;
        }
        .blinfo_sex{
            margin-top: 12px;
            width: 100%;
            height: 40px;
        }

    </style>
@endsection
@section('content')

    <div class="main_header clearfix">
        <form action="{{url('admin/vip/')}}" method="post">
            {{csrf_field()}}
        <div class="main_header_search clearfix">
            <div class="input-group input_style"  style="width:200px;">
                <input type="text" class="form-control" placeholder="输入用户名" value="{{ $name or ''}}" name="username" style="height: 40px;"/>
                <span class="input-group-btn">
                <button type="submit" class="btn btn-info btn-search glyphicon glyphicon-search" style="margin-top:28px;background: #3FB2F7;height: 40px; "></button>
               </span>
            </div>
        </div>
        </form>
        {{--<div class="main_header_add clearfix" >会员添加暂时不需要--}}
            {{--<div class="add_box" data-toggle="modal" data-target="#myModal">--}}
                {{--<img src="{{asset('images/add_icon.png')}}" alt="">--}}
                {{--<span>新增</span>--}}
            {{--</div>--}}
            {{--<div class="add_box">--}}
                {{--<img src="{{asset('images/lodingin_icon.png')}}" alt="">--}}
                {{--<span style="color:orange">导入</span>--}}
            {{--</div>--}}
        {{--</div>--}}
    </div>
    <div class="main_form clearfix">
        <!-- 表格 -->
        <div class="main_formlist">

            <table class="table table-bordered main_table">
                <tbody>
                <tr>
                    <th>姓名</th>
                    <th>身份证号码</th>
                    <th>联系方式</th>
                    <th>注册时间</th>
                    <th>性别</th>
                    <th>操作</th>
                </tr>

                @foreach($vips as $vip)
                    <tr>
                        <td>{{$vip->name}}</td>
                        <td>{{$vip->id_card}}</td>
                        <td>{{$vip->telphone}}</td>
                        <td>{{$vip->created_at}}</td>
                        <td>{{$vip->sex==1?'男':' 女'}}</td>
                        <td>
                            @if(Auth::guard('admin')->user()->checkPermission('vip.list'))
                          <span class="formlist_handle">
                           <a href="{{url('/admin/vip/show',['vip_id'=>$vip->id])}}" class="formlist_edit">
                               查看</a>
                        </span>
                                @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>

            </table>
        </div>
        <div class="boot_fenye">
            <div class="boot_page">
                <div class="boot_page_di">第<span class="">{{ $page = isset($_GET['page'])?$_GET['page']:1}}</span>页
                </div>
                <div  class="boot_page_total">共<span>{{$total_page}}</span>页
                </div>
            <div class="boot_choose">
                {{$vips->appends(['name'=>$name])->render()}}
            </div>
        </div>

    </div>


@endsection
<!-- Modal 会员是不可以单独新增的,注意!!!注意!!!-->
<div style="display: none;margin-top: 100px;" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="background: #3D446B;">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: white;"><span aria-hidden="true"><img
                                src="{{asset('/images/cancel_icon.png')}}" alt=""></span></button>
                <h4 class="modal-title" id="myModalLabel" style="color: white;text-align: center; font-size: 24px;">新增</h4>
            </div>
            <form action="{{url('admin/vip/store')}}" method="post">
            <div class="modal-body">
               <div class="modal_info clearfix">
                   <p class="blinfo"><span>姓名</span><br>
                   <input type="text" name="username" value=""></p>
                   <p class="blinfo"><span>年龄</span><br>
                       <input type="text" name="age" value=""></p>
                   <p class="blinfo"><span>性别</span><br>
                       <input type="text" name="sex" value=""></p>
                   <p class="blinfo"><span>联系方式</span><br>
                       <input type="text" name="telphone" value=""></p>
                   <p class="blinfo"><span>身份证号码</span><br>
                       <input type="text" name="id_card" value=""></p>
               </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <input type="submit" value="保存" class="btn btn-primary" style="height:40px;border: 0px solid;width: 300px;background: #2BAAF7" />
            </div>
            </form>
        </div>
    </div>
</div>



